<?php

class db{
	
	public $db;
	
	function __construct(){
		global $config;
		$con = mysql_connect($config['db']['host'].':'.$config['db']['port'], $config['db']['user'], $config['db']['pwd']) or die(mysql_error());
		mysql_set_charset($config['db']['char'], $con);
		mysql_select_db($config['db']['name']);
		if($con){
			$this->db = $con;
		}else{
			$this->db = false;
		}
	}
	
}